import type { Meta, StoryObj } from '@storybook/react-webpack5';
import Button from './button';

const meta: Meta<typeof Button> = {
  title: '第四章：Button',
  component: Button,
};
export default meta;

type Story = StoryObj<typeof Button>;

export const ADefault: Story = {
  args: {
  children: 'Default Button',
    disabled: false,
    size: 'lg',
    btnType: 'primary',
    href: '',
  },
  name: '默认按钮样式',
};

export const BButtonWithSize: Story = {
  args: {
    ...ADefault.args,
    size: 'lg',
  },
  render: (args) => (
  <>
      <Button {...args} size="lg"> large button </Button>
      <Button {...args} size="sm"> small button </Button>
  </>
  ),
  name: '不同尺寸的按钮',
};

export const CButtonWithType: Story = {
  args: {
    ...ADefault.args,
    btnType: 'primary',
  },
  render: (args) => (
  <>
      <Button {...args} btnType="primary"> primary button </Button>
      <Button {...args} btnType="danger"> danger button </Button>
      <Button {...args} btnType="link" href="https://google.com"> link button </Button>
  </>
  ),
  name: '不同类型的按钮',
};